package com.anan;

import java.awt.*;

/**
 * @Author: Painter
 * @project_name: aircraft-war
 * @system_login: sunshine
 * @time: 2023/11/520:15
 */


public class Bullet {
    private int x;
    private int y;
    private Image image;

    public Bullet(int x, int y) {
        this.image = Imagevalue.bullet1;
        this.x = x;
        this.y = y;
    }

    public Bullet(int x, int y,int num) {
        this.image = Imagevalue.bullet2;
        this.x = x;
        this.y = y;
    }
    private boolean isalive = true;

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public Image getImage() {
        return image;
    }

    public void setImage(Image image) {
        this.image = image;
    }

    public boolean getIsalive() {
        return isalive;
    }

    public void setIsalive(boolean isalive) {
        this.isalive = isalive;
    }

    public void move() {  // 移动子弹
        this.y -= 10;
        if (this.y < 0) {  // 如果子弹坐标小于0
            this.setIsalive(false);  // 设置存活状态为false
        }
    }
}
